<template>
  <div class="Showcase2">
    <div class="Showcase2-top">
      <img
        class="Showcase2-top-left"
        :src="publicUrls + 'free/style10/Showcase3bg1.webp'"
        alt=""
      />
      <div
        class="Showcase2-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style10/Showcase3bg2.webp'})`,
        }"
      ></div>
      <img
        class="Showcase2-top-right"
        :src="publicUrls + 'free/style10/Showcase3bg3.webp'"
        alt=""
      />
    </div>
    <div class="Showcase2-center">
      <div
        :style="{
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 1.013)}rem`,
        }"
        class="ex-item"
        v-for="(item, index) in props.list"
        :key="index"
      >
        <div class="item-solid"></div>
        <div
          class="name-box"
          :style="{ backgroundImage: `url(${publicUrls + 'free/style10/Showcase3bg10.webp'})` }"
        >
          <span>{{ item.name }}</span>
        </div>
        <div class="item-solid"></div>
      </div>
      <div
        class="Showcase2-center-left"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style10/Showcase3bg4.webp'})`,
        }"
      ></div>
      <div
        class="Showcase2-center-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style10/Showcase3bg5.webp'})`,
        }"
      ></div>
      <div
        class="Showcase2-center-right"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style10/Showcase3bg6.webp'})`,
        }"
      ></div>
    </div>
    <div class="Showcase2-bottom">
      <img
        class="Showcase2-bottom-left"
        :src="publicUrls + 'free/style10/Showcase3bg7.webp'"
        alt=""
      />
      <div
        class="Showcase2-bottom-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style10/Showcase3bg8.webp'})`,
        }"
      ></div>
      <img
        class="Showcase2-bottom-right"
        :src="publicUrls + 'free/style10/Showcase3bg9.webp'"
        alt=""
      />
    </div>
    <!-- Showcase2Topleft -->
  </div>
</template>    

<script lang="ts">
export default defineComponent({
  name: 'style2',
});
</script>
  
<script setup lang="ts">
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x + 0.3;
};
</script>  

<style scoped lang="less">
.Showcase2 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 314px;
  min-width: 404px;
  -webkit-box-reflect: none;
}
.Showcase2-top {
  position: relative;
  display: flex;
  width: 100%;
  height: 116px;
}
.Showcase2-top-left {
  width: 54px;
  height: 116px;
}
.Showcase2-top-center {
  flex: 1;
  height: 116px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase2-top-right {
  width: 53px;
  height: 116px;
}
.ex-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: -16px; 
  width: 146px;  
  height: calc(100% + 34px);
  z-index: 30; 
  background-repeat: no-repeat;
  background-size: 100% 100%;
  .item-solid { 
    width: 2px;
    flex: 1; 
    background: #626262;
    border-radius: 0px 0px 0px 0px;
    background: #8e8e8e;
  }
  .name-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 146px;
    height: 147px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    span {
      display: block;
      width: 18px;
      height: 100px;
      font-family: PingFang SC;
      font-size: 16px;
      color: #545453;
      line-height: 20px;
      writing-mode: vertical-rl;
      /* 文字从右向左竖向排列，也可使用 vertical-lr 从左向右竖向排列 */
      text-orientation: upright;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      text-align: center;
    }
  }
}

.Showcase2-center {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100% - 177px);
}
.Showcase2-center-left {
  width: 54px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase2-center-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase2-center-right {
  width: 53px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase2-bottom {
  position: relative;
  display: flex;
  width: 100%;
  height: 61px;
}
.Showcase2-bottom-left {
  width: 54px;
  height: 61px;
}
.Showcase2-bottom-center {
  flex: 1;
  height: 61px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase2-bottom-right {
  width: 53px;
  height: 61px;
}
</style>